import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooMinishopOrderDetailController } from '../../../controllers';
const uctoominishopOrderDetailRouter = new Router();
const minishopOrderDetailController = new uctooMinishopOrderDetailController();

uctoominishopOrderDetailRouter.post('/add', requireUser, minishopOrderDetailController.add);
uctoominishopOrderDetailRouter.post('/edit', requireUser, rowLevelPermission('uctoo/minishop_order_detail'), minishopOrderDetailController.edit);
uctoominishopOrderDetailRouter.post('/del', requireUser, rowLevelPermission('uctoo/minishop_order_detail'), minishopOrderDetailController.delete);

//For getting minishopOrderDetail with permission control
uctoominishopOrderDetailRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/minishop_order_detail'), minishopOrderDetailController.getSingle);
uctoominishopOrderDetailRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/minishop_order_detail'), minishopOrderDetailController.getMany);
uctoominishopOrderDetailRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/minishop_order_detail'), minishopOrderDetailController.getMany);

//#endregion AutoCreateCode
export default uctoominishopOrderDetailRouter;
